|
|
|
|
|
|
|
The saveRegSetting method wraps the call to the corresponding saveSetting function. It's responsible for saving or creating an application entry in the Windows Registry. Its arguments are argAppName, argSection, argKey, and argSetting. |
|
|
|
|
|
|
|
|
The argAppName argument represents a String expression that contains the name of the application or project to which the setting applies. The argSection argument is a String expression that contains the name of the section where the key setting is being saved. The argKey argument is a String expression that contains the name of the key setting being saved. Finally, the argSetting argument is a Variant expression that contains the value that key is being set to. |
|
|
|
|
|
|
|
|
The getRegSetting method calls the GetSetting Registry function that returns a key setting value from your application's entry in the Windows Registry. The arguments are similar to the previous method, except for the optional argDefault argument. The argDefault argument expression, if present, contains the value to return if no value is set in the key setting. If it is missing, Visual Basic assumes the default value is a zero-length string (). Within the method, a Switch statement usage simplifies the checking of boolean expressions. Here, you want to make sure the client provides the AppName and Section values that the Registry needs. |
|
|
|
|
|
|
|
|
The remainder of the method sets corresponding properties when the Registry item is returned. |
|
|
|
|
|
|
|
|
The getAllRegSettings method calls the GetAllSettings Registry method that returns a list of key settings and their respective values from an application's entry in the Windows Registry. Its arguments are the same as the previous methods discussed, except for an optional argument, argListViewObj. The argument argListViewObj is a list view object that contains the list of settings returned. It needs the corresponding objColHdr and objListItem objects to populate it. This list view population works only if the variable localRegSettings is indeed an array. That's why the following line is needed to prevent the occurrence of an error: |
|
|
|
|
|
|
|
|
If Not IsArray(localRegSettings) Then Exit Function |
|
|
|
|
|
|
|
|
The deleteRegSetting method calls DeleteSetting Registry method that deletes a section or key setting from your application's entry in the Windows Registry. It has three arguments similar to their counterparts in the other methods. With this method, though, the argKey argument is optional. This optional argument is optional because the DeleteSetting method does not require it. |
|
|
|
|
|
|
|
|
The remaining methods are not required at all. They simply enable you to access the Registry using the Shell command. The method initializeRegistry executes the Registry's executable to prepare it for SendKey operations. The findFirstItem method |
|
|
|
|
|